import Vue from 'vue'
import VueRouter from 'vue-router'
import Accuse from '../views/Accuse.vue'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/welcome'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
  },
  {
    path: '/new',
    name: 'New',
    component: () => import('../views/New.vue')
  },
  {
    path: '/accuse',
    name: 'Accues',
    component: Accuse,
    children: [{
        path: '/accuse/add',
        component: () => import('../components/Add.vue')
      },
      {
        path: '/accuse/approve',
        component: () => import('../components/Approve.vue')
      },
      {
        path: '/accuse/records',
        component: () => import('../components/Records.vue')
      },
      {
        path: '/accuse/user',
        component: () => import('../components/User.vue')
      },
      {
        path: '/welcome',
        component: () => import('../components/Welcome.vue')
      },
      {
        path: '/accuse/accusedetail',
        component: () => import('../components/AccuseDetail.vue')
      },
      {
        path: '/accuse/accuseedit',
        component: () => import('../components/AccuseEdit.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( /* webpackChunkName: "about" */ '../views/Login.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router